View Javadoc

1   // Class.java, created Fri Aug 16 18:11:48 2002 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.ClassLib.sun14_linux.java.lang;
5   
6   /***
7    * Class
8    *
9    * @author  John Whaley <jwhaley@alum.mit.edu>
10   * @version $Id: Class.java 1451 2004-03-09 06:27:08Z jwhaley $
11   */
12  public final class Class {
13      
14      private native java.lang.reflect.Field[] getFields0(int m);
15      private native java.lang.reflect.Method[] getMethods0(int m);
16      private native java.lang.reflect.Constructor[] getConstructors0(int m);
17      
18      private java.lang.reflect.Field[] getDeclaredFields0(boolean publicOnly) {
19          java.lang.reflect.Field[] f = getFields0(java.lang.reflect.Member.DECLARED);
20          if (publicOnly) {
21              int count = 0;
22              for (int i=0; i<f.length; ++i) {
23                  if (java.lang.reflect.Modifier.isPublic(f[i].getModifiers()))
24                      ++count;
25              }
26              java.lang.reflect.Field[] f2 = new java.lang.reflect.Field[count];
27              --count;
28              for (int i=0, j=-1; j<count; ++i) {
29                  if (java.lang.reflect.Modifier.isPublic(f[i].getModifiers()))
30                      f2[++j] = f[i];
31              }
32              f = f2;
33          }
34          return f;
35      }
36      private java.lang.reflect.Method[] getDeclaredMethods0(boolean publicOnly) {
37          java.lang.reflect.Method[] f = getMethods0(java.lang.reflect.Member.DECLARED);
38          if (publicOnly) {
39              // TODO.
40          }
41          return f;
42      }
43      private java.lang.reflect.Constructor[] getDeclaredConstructors0(boolean publicOnly) {
44          java.lang.reflect.Constructor[] f = getConstructors0(java.lang.reflect.Member.DECLARED);
45          if (publicOnly) {
46              // TODO.
47          }
48          return f;
49      }
50      
51      private static boolean desiredAssertionStatus0(Class clazz) {
52          // TODO.
53          return false;
54      }
55  }